﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Slb.Ocean.Petrel.UI;

namespace Public.Ocean.Petrel.Extensions.Services
{
    public static class ElementBehaviorExtensions 
    {
        public static bool HasBehavior(this IElementBehavior behavior, object domainObj, IToggleWindow window, ElementBehaviors test)
        {
            if (domainObj == null) return false;

            return (behavior.GetBehavior(domainObj, new ElementContext(window)) & test) == test;
        }
    }
}
